package Database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author CONG
 */
public class LoanConnection {

    private String url = "jdbc:sqlserver://localhost;databasename=LoanManager";
    private String name = "sa";
    private String pass = "123456";
    private Connection conn;
    public LoanConnection() {
    }
    public Connection connect(){
     try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            conn=DriverManager.getConnection(url, name, pass);
            return conn;
        } catch(Exception ex)  {
            Logger.getLogger(LoanConnection.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
